from google.appengine.ext import db

class LogEntry (db.Model):
    domain = db.StringProperty(required=True)
    context = db.StringProperty(required=True)
    eventtype = db.StringProperty(required=True)
    timestamp = db.DateTimeProperty(auto_now_add=True)
    msg_key = db.StringProperty()
    msg_value = db.TextProperty()

class LogClient (db.Model):
    name = db.StringProperty(required=True)
    auth_key = db.StringProperty(required=True)

class LogSubscriber (db.Model):
    domain = db.StringProperty()
    context = db.StringProperty()
    eventtype = db.StringProperty()
    msg_key = db.StringProperty()
    receiver_type = db.StringProperty(required=True, choices=set(["xmpp","email"]))
    receiver_address = db.StringProperty(required=True)

class SettingsEntry(db.Model):
    skey = db.StringProperty()
    sval = db.StringProperty()

